import request from '@/utils/request.js'
const PATH = '/user/client'

// 登录
export const login = (data) => request.post(PATH + '/login', data)

// 验证token是否有效
export const checkUserToken = (token) =>
  request.get(PATH + '/checkUserToken', { params: { token } })

// 注册
export const register = (data) => request.post(PATH + '/register', data)

// 获取用户信息
export const getUserInfo = (params) =>
  request.get(PATH + '/getUserById', { params })

// 修改用户信息
export const updateUserInfo = (data) => request.put(PATH + '/update', data)

// 判断旧密码
export const verifyOldPassword = (params) =>
  request.get(PATH + '/verifyPwd', { params })

// 新增游湖访问量
export const addVisitor = ({ id }) => request.put(PATH + `/addVisitor/${id}`)

// 校验手机号
export const verifyPhoen = (params) =>
  request.get(PATH + '/verifyPhone', { params })

// 重置密码
export const resetPassword = (data) => request.put(PATH + '/resetPwd', data)
